home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 1
/
SPACE - Library 1 - Volume 1.iso
/
program
/
441
/
dlibs12
/
getcwd.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-11-23
|
334b
|
19 lines
#include <stdio.h>
#include <limits.h>
#include <malloc.h>
char *getcwd(buf, limit)
char *buf;
register int limit;
{
char cwd[PATHSIZE], *strcpy();
if((buf == NULL)
&& ((buf = malloc(limit)) == NULL))
return(NULL);
fullpath(cwd, "");
if(strlen(cwd) < limit)
return(strcpy(buf, cwd));
return(NULL);
}